package top.jiangqiang.qyblog.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 错误码100-1000 尽可能与http标准响应码保持一致
 * 10000-99999，本项目保留备用
 * 其他模块错误码应该大于100000
 *
 * @author Jiangqiang
 */
@Getter
@AllArgsConstructor
public enum ResponseEnum {
    //操作成功
    SUCCESS(200, "OK"),
    ERROR(400, "ERROR"),
    UNAUTHORIZED(401, "身份验证失败，请重新登录"),
    FORBIDDEN(403, "没有访问权限"),
    NOT_FOUND(404, "找不到页面"),
    METHOD_NOT_ALLOWED(405, "请求方法不允许"),
    REQUEST_TIMEOUT(408, "请求超时"),
    INTERNAL_SERVER_ERROR(500, "系统内部错误"),

    //自定义错误码
    ADMINISTRATOR_ACCOUNT_WAS_NOT_INITIALIZED(10001, "系统没有初始化账户，请先注册"),
    BLOG_CONFIG_WAS_NOT_INITIALIZED(10002, "博客必要信息没有初始化，请先设置"),
    STORAGE_CONFIG_WAS_NOT_INITIALIZED(10003, "存储策略没有初始化，请先设置"),
    ;

    private final int code;
    private final String message;

}
